package com.example.demo.services.impl;

import com.example.demo.dao.PSRepository;
import com.example.demo.entity.HD;
import com.example.demo.entity.PS;
import com.example.demo.services.PSService;
import com.example.demo.services.PSService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PSServiceImpl implements PSService {

    @Autowired
    private PSRepository psRepository;

    /**
     * @Author: Ding XiJie
     * @Description: 添加配送
     */
    @Override
    public PS save(PS ps) {
        ps = psRepository.save(ps);
        return ps;
    }

    /**
     * @Author: Ding XiJie
     * @Description: 修改配送
     */
    @Override
    public PS update(PS ps) {
        return psRepository.save(ps);
    }

    /**
     * @Author: Ding XiJie
     * @Description: 删除配送
     */
    @Override
    public void delete(int id) {
        psRepository.deleteById(id);
    }

}
